package designPatterns.P02_工厂模式_Factory.P03_抽象工厂.P01_PizzaStore.order;

import designPatterns.P02_工厂模式_Factory.P03_抽象工厂.P01_PizzaStore.pizza.BJCheesePizza;
import designPatterns.P02_工厂模式_Factory.P03_抽象工厂.P01_PizzaStore.pizza.BJPepperPizza;
import designPatterns.P02_工厂模式_Factory.P03_抽象工厂.P01_PizzaStore.pizza.Pizza;

/**
 * @author d11yu
 */
public class BJFactory implements AbsFactory {
    @Override
    public Pizza createPizza(String type) {
        Pizza pizza = null;
        switch (type) {
            case "cheese":
                pizza = new BJCheesePizza();
                break;
            case "pepper":
                pizza = new BJPepperPizza();
                break;
            default :
                pizza =null;
                break;
        }

        return pizza;
    }
}
